package StudyCode.summary.csv;

import java.io.IOException;
import java.io.Writer;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class WriteCSVLine {
	public static final char COLUMN_SEPARATOR = ';';
	public static final char LINE_SEPARATOR = '\n';

	public static void writeCsvLine(Writer writer, String[] data)
			throws IOException {
		final int len = data.length;
		for (int i = 0; i < len; i++) {
			writer.write(data[i]);
			if ((i + 1) < len) {
				writer.write(COLUMN_SEPARATOR);
			}
		}
		if (len > 0) {
			writer.write(LINE_SEPARATOR);
		}
	}
}
